/* $Id: ServiceDAO.java 
 * Copyright (C) 2011, TRAKHEES
 *  
 * Revision History
 *
 * Date  			Author 		    	Remarks
 * ---------------------------------------------------------------------------------
 *
 */
package ae.pcfc.etks.online.common.dao;


import java.util.List;

import ae.pcfc.etks.online.common.domain.Service;
import ae.pcfc.etks.online.common.vo.PagingVO;

public interface ServiceDAO {
	
	/**
	 * add
	 * Method to add a Service domain objec to the database
	 * @param services
	 * @return
	 * boolean
	 */
	public boolean add(Service services);
	
	/**
	 * getServicesList
	 * Method to get the list of available active services
	 * @return
	 * List<Service>
	 */
	public List<Service> getServicesList();
	
	/**
	 * getServiceByPrimaryKey
	 * Method to find the service by primary key
	 * @param Id
	 * @return
	 * Service
	 */
	public Service getServiceByPrimaryKey(Long Id);
	
	/**
	 * deleteServiceById
	 * Method to delete a service domain object by primary key
	 * @param Id
	 * @return
	 * boolean
	 */
	public boolean deleteServiceById(Long Id);
	
	/**
	 * findServiceByServiceRoleIds
	 * Method to find the list of services by service role ids and default code
	 * @param serviceRoleIds
	 * @param strDefault
	 * @return
	 * List<Service>
	 */
	public List<Service> findServiceByServiceRoleIds(List<Long> serviceRoleIds, String strDefault);
	
	/**
	 * findServiceAvailableByUserNameAndRoleIds
	 * Method to find the list of services that a user can regsiter by providing the role ids list 
	 * This method removes the already registered and approved service from the list and
	 * adds the services which are registerd and rejected earlier 
	 * @param userName
	 * @param roleIds
	 * @return
	 * List<Service>
	 */
	public List<Service> findServiceAvailableByUserNameAndRoleIds(String userName, List<Long> roleIds);
	
	/**
	 * findServiceByPrimaryKey
	 * Method to find the service domain object by primary key
	 * @param id
	 * @return
	 * Service
	 */
	public Service findServiceByPrimaryKey(Long id);
	
	/**
	 * findServiceListByIds
	 * Method to find the list of service domain objects by the list of service ids
	 * @param ids
	 * @return
	 * List<Service>
	 */
	public List<Service> findServiceListByIds(List<Long> ids);
	
	/**
	 * findServiceListByUserName
	 * Method to list of services that the user is associated with
	 * @param userName
	 * @return
	 * List<Service>
	 */
	public List<Service> findServiceListByUserName(String userName);
	
	/**
	 * delete
	 * Method to delete the service domain object
	 * @param service
	 * void
	 */
	public void delete(Service service);
	
	/**
	 * findUserDefaultService
	 * Method to find the user default service
	 * @return
	 * Service
	 */
	public Service findUserDefaultService();
	
	/**
	 * findServiceByServiceDefault
	 * Method to find the service by service default code
	 * @param strServiceDefault
	 * @return
	 * Service
	 */
	public Service findServiceByServiceDefault(String strServiceDefault);	
	
	/**
	 * getServicesListByPagingVO
	 * Method to find the list of services page based on the paging information 
	 * @param pagingVO
	 * @return
	 * List<Service>
	 */
	public List<Service> getServicesListByPagingVO(PagingVO pagingVO);
	
	/**
	 * udpate
	 * Method to update the service domain object
	 * @param service
	 * void
	 */
	public void udpate(Service service);
}
